<?php
/**
 * dbfront
 * (c) 2010-2013 Stephen Adkins <spadkins@gmail.com>
 * This software began development in 2010.
 * It is based on code dating from 1999.
 *
 * License: GPL 2.0
 * The contents of this file may be used under the terms of
 * the GNU General Public License Version 2 or later (the "GPL").
 *
 * Software distributed under the License is distributed on an "AS IS" basis,
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 * for the specific language governing rights and limitations under the
 * License.
 * */

# $encrypt_password=md5($password);

$options = file_exists("conf/options.ini") ? parse_ini_file("conf/options.ini") : Array();
$options['prefix'] = dirname(__FILE__);

$old_include_path = get_include_path();
if (isset($options['include_path'])) {
    $include_path = $options['include_path'] . ":" . $old_include_path;
    set_include_path($include_path);
}
else {
    $include_path = $old_include_path;
}

require_once('App.php');
$context    = App::context($options);
$test_mode  = (isset($options['test_mode']))  ? $options['test_mode']  : 0;
$title      = (isset($options['app.title']))  ? $options['app.title']  : "sitefront";
$favicon    = (isset($options['favicon']))    ? $options['favicon']    : "favicon.ico";
$ext_home   = (isset($options['ext_home']))   ? $options['ext_home']   : "../ext-4.1.1a";
$ext_jsfile = (isset($options['ext_jsfile'])) ? $options['ext_jsfile'] : "ext-all-debug.js";

?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8"/>
    <title><?php echo $title; ?></title>
    <link rel="stylesheet" href="<?php echo $ext_home; ?>/resources/css/ext-all-gray.css"/>
    <script type="text/javascript">
        FrontSuite = new Object();
        FrontSuite.session = new Object();
        FrontSuite.options = new Object();
        FrontSuite.options['app.title']  = "<?php echo $title; ?>";
        FrontSuite.options['ext_home']   = "<?php echo $ext_home; ?>";
        FrontSuite.options['ext_jsfile'] = "<?php echo $ext_jsfile; ?>";
    </script>
    <script src="<?php echo $ext_home; ?>/<?php echo $ext_jsfile; ?>"></script>
    <script type="text/javascript" src="js/sjcl.js"></script>
    <script src="app.js"></script>
</head>
<body>
</body>
</html>

